// ==UserScript==
// @name         [kesai]chess.com动态切换显示比赛时间
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.chess.com/live*
// @require      https://code.jquery.com/jquery-3.3.1.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    //var switchBtn=$('<button type="button" >时间</button>');
    //$('.clock-component')[1].before(switchBtn); 
    window.onload = function() {
        //$('.clock-component').css('display','none');
        // alert();
    }
    var switchBtn = $('<button type="button"  style="position:absolute;left:520px;top:710px;">隐藏时间</button>')
    $("body").append(switchBtn);

    switchBtn.click(function() {
        if (switchBtn.text() === "隐藏时间") {
            switchBtn.text('显示时间');
            $('.clock-component:eq(1)').css('display', 'none');
        } else {
            switchBtn.text('隐藏时间');
            $('.clock-component:eq(1)').css('display', 'block');
        }
    });


})();